package com.ctibook.booksystem.job;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import com.ctibook.booksystem.service.bookcatalog.BookInfoService;

/**
 * @author 鲁永刚 E-mail: luyg@ctibook.com
 * @version 创建时间：Sep 19, 2014 4:35:44 PM 类说明
 */
@Component("rebuildIndexJob")
public class RebuildIndexJob {

	static Logger log = Logger.getLogger(RebuildIndexJob.class);
	@Resource
	private BookInfoService bookInfoService;
	
	
	public void doWork() {
		try {
			log.info("开始同步索引书目信息");
			bookInfoService.rebuildIndex();
			log.info("书目信息索引同步完成");
			log.info("开始同步索引书目附加信息");
			bookInfoService.rebuildIndexBookInfoExtral();
			log.info("书目附加信息索引同步完成");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
